import logo from './logo.svg';
import './App.css';
import React, { Component,useState } from 'react';
import {CSSTransition} from 'react-transition-group'

function App() {
  const [visible,setVisible]=useState(true)
  return (
    <>
    <CSSTransition timeout={2000} in={visible} appear>
      <h1>一个标题</h1>

    </CSSTransition>
    <button onClick={()=>{
      setVisible(!visible)
    }}>
      切换
    </button>
    </>
    
  );
  
  
}

export default App;
